<div class="bjui-pageContent">
    <form action="/admin/administration/cost-management/bill-edit" data-toggle="ajaxform"
          data-options="{closeCurrent: true, okAfterCallback: freshPostPersonnel}">
        <input type="hidden" name="oa_company_id" value="{{$billInfo['oa_company_id']}}">
        <input type="hidden" name="id" value="{{$billInfo['id']}}">
        <div class="bjui-row col-3">
            <label class="row-label">单价</label>
            <div class="row-input required">
                <input type="text" class="input-sm" name="unit_price" value="{{$billInfo['unit_price']}}"
                       data-rule="required;number">
            </div>
            <label class="row-label">上期数量</label>
            <div class="row-input required">
                <input type="text" class="input-sm" name="prior_number" value="{{$billInfo['prior_number']}}"
                       data-rule="required;number">
            </div>
            <label class="row-label">本期数量</label>
            <div class="row-input required">
                <input type="text" class="input-sm" name="current_number" value="{{$billInfo['current_number']}}"
                       data-rule="required;number">
            </div>
            <label class="row-label">减免单价</label>
            <div class="row-input">
                <input type="text" class="input-sm" name="abatement_unit_price"
                       value="{{$billInfo['abatement_unit_price']}}">
            </div>
            <label class="row-label">减免数量</label>
            <div class="row-input">
                <input type="text" class="input-sm" name="abatement_number"
                       value="{{$billInfo['abatement_number']}}">
            </div>
            <label class="row-label">应收金额</label>
            <div class="row-input required">
                <input type="text" class="input-sm" name="money" value="{{$billInfo['money']}}"
                       data-rule="required;number">
            </div>
            <label class="row-label">已收金额</label>
            <div class="row-input">
                <input type="text" class="input-sm" name="amount_received" value="{{$billInfo['amount_received']}}">
            </div>
            <label class="row-label">开始时间</label>
            <div class="row-input required">
                <input type="text" value="{{date('Y-m-d',$billInfo['start_time'])}}" data-toggle="datepicker"
                       placeholder="点击选择日期" name="start_time" data-rule="required;date">
            </div>
            <label class="row-label">结束时间</label>
            <div class="row-input required">
                <input type="text" value="{{date('Y-m-d',$billInfo['end_time'])}}" data-toggle="datepicker"
                       placeholder="点击选择日期" name="end_time" data-rule="required;date">
            </div>
            <label class="row-label ">缴费截止日期</label>
            <div class="row-input required">
                <input type="text" value="{{date("Y-m-d",$billInfo['time'])}}" data-toggle="datepicker"
                       placeholder="点击选择日期" name="time" data-rule="required;date">
            </div>
            <label class="row-label ">账单出账日期</label>
            <div class="row-input required">
                <input type="text" value="{{date("Y-m-d",$billInfo['billing_date'])}}" data-toggle="datepicker"
                       placeholder="点击选择日期" name="billing_date"
                       data-rule="required;date">
            </div>
            <label class="row-label">最后缴费时间</label>
            <div class="row-input">
                <input type="text"
                       @if($billInfo['payment_time']!=0)value="{{date('Y-m-d',$billInfo['payment_time'])}}"
                       @endif data-toggle="datepicker" placeholder="点击选择日期" name="payment_time" data-rule="date">
            </div>
            <label class="row-label">类型</label>
            <div class="row-input required">
                <select data-toggle="selectpicker" name="type">
                    <option value="1" @if($billInfo['type']==1)selected="selected"@endif>电费</option>
                    <option value="2" @if($billInfo['type']==2)selected="selected"@endif>水费</option>
                </select>
            </div>
            <label class="row-label">状态</label>
            <div class="row-input">
                <select data-toggle="selectpicker" name="status">
                    <option value="0" @if($billInfo['status']==0)selected="selected"@endif>待缴费</option>
                    <option value="1" @if($billInfo['status']==1)selected="selected"@endif>已缴费</option>
                    <option value="2" @if($billInfo['status']==2)selected="selected"@endif>逾期</option>
                    <option value="3" @if($billInfo['status']==2)selected="selected"@endif>逾期已缴费</option>
                </select>
            </div>
        </div>
    </form>
</div>
<div class="bjui-pageFooter">
    <ul>
        <li>
            <button type="button" class="btn-close" data-icon="close">取消</button>
        </li>
        <li>
            <button type="submit" class="btn-default" data-icon="save">保存</button>
        </li>
    </ul>
</div>
<script>
    function freshPostPersonnel() {
        $("#bill-list").datagrid("refresh", true);
    }
</script>
